{{- if or (hasKey .Values.certManager "route53SecretAccessKey") (hasKey .Values.certManager "route53AccessKeyID") }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: route53
  namespace: d8-cert-manager
  {{- include "helm_lib_module_labels" (list . (dict "app" "cert-manager")) | nindent 2 }}
data:
  {{- if and (hasKey .Values.certManager "route53SecretAccessKey") (.Values.certManager.route53SecretAccessKey) }}
  secret-access-key: {{ .Values.certManager.route53SecretAccessKey | b64enc | quote }}
  {{- else }}
    {{ cat "No key certManager.route53SecretAccessKey in deckhouse configmap" | fail }}
  {{- end }}
{{- end }}
